scalebutton: Stop relying on GtkBox's pack-type child prop
authorTimm Bäder <mail@baedert.org>
Wed, 26 Dec 2018 07:26:41 +0000 (08:26 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 24 Jan 2019 00:30:46 +0000 (19:30 -0500)
gtk/gtkscalebutton.c

index 116ccef306a98160acedff4b2968132e3fba65d6..9102b333c111909b55556804d95220d4a3a52193 100644 (file)
@@ -724,18 +724,20 @@ apply_orientation (GtkScaleButton *button,
     {
       priv->applied_orientation = orientation;
       gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), orientation);
-      gtk_container_child_set (GTK_CONTAINER (priv->box),
-                               priv->plus_button,
-                               "pack-type",
-                               orientation == GTK_ORIENTATION_VERTICAL ?
-                               GTK_PACK_START : GTK_PACK_END,
-                               NULL);
-      gtk_container_child_set (GTK_CONTAINER (priv->box),
-                               priv->minus_button,
-                               "pack-type",
-                               orientation == GTK_ORIENTATION_VERTICAL ?
-                               GTK_PACK_END : GTK_PACK_START,
-                               NULL);
+
+      if (orientation == GTK_ORIENTATION_HORIZONTAL)
+        {
+          gtk_box_reorder_child (GTK_BOX (priv->box), priv->scale, 0);
+          gtk_box_reorder_child (GTK_BOX (priv->box), priv->minus_button, 1);
+          gtk_box_reorder_child (GTK_BOX (priv->box), priv->plus_button, 2);
+        }
+      else
+        {
+          gtk_box_reorder_child (GTK_BOX (priv->box), priv->scale, 1);
+          gtk_box_reorder_child (GTK_BOX (priv->box), priv->minus_button, 2);
+          gtk_box_reorder_child (GTK_BOX (priv->box), priv->plus_button, 0);
+
+        }
 
       gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->scale), orientation);